import request from "@/sheep/request";

export default {
    // 地区
    getCityList: (params = {}) =>
        request({
            url: "/no-auth/xk-movie/cityList",
            method: "GET",
            params,
            custom: {
                showLoading: false,
                showError: true,
            },
        }),
    // 根据城市编码获取区县列表
    getCountyList: (params = {}) =>
        request({
            url: "/no-auth/xk-movie/countyList",
            method: "GET",
            params,
            custom: {
                showLoading: false,
                showError: true,
            },
        }),
    getHotMovieList: (params = {}) =>
        request({
            url: "/no-auth/xk-movie/hotMovieList",
            method: "GET",
            params,
            custom: {
                showLoading: true,
                showError: true,
            },
        }),
    getCinemaList: (params = {}) =>
        request({
            url: "/no-auth/xk-movie/cinemaList",
            method: "GET",
            params,
            custom: {
                showLoading: true,
                showError: true,
            },
        }),
    // 影片近期有排片的影院id
    getOpiList: (params = {}) =>
        request({
            url: "/no-auth/xk-movie/getOpiV3List",
            method: "GET",
            params,
            custom: {
                showLoading: false,
                showError: true,
            }
        }),
    // 座位图
    getOpiSeat: (params = {}) =>
        request({
            url: "/no-auth/xk-movie/getOpiSeat",
            method: "GET",
            params,
            custom: {
                showLoading: false,
                showError: true,
            }
        }),
    // 锁座下单
    lockSeat: (data = {}) =>
        request({
            url: "/h5/xk-movie/order/lockSeat",
            method: "POST",
            data,
            custom: {
                showLoading: true,
                showError: true,
            }
        }),
    // 订单详情
    orderDetail: (params = {}) =>
        request({
            url: "/h5/xk-movie/order/orderDetail",
            method: "GET",
            params,
            custom: {
                showLoading: false,
                showError: true,
            }
        }),
    // 电影支付
    payMovieAdd: (data = {}) =>
        request({
            url: "/h5/xk-movie/order/moviePay",
            method: "POST",
            data,
            custom: {
                showLoading: true,
                showError: true,
            }
        }),
    // 电影订单列表
    getXkMovieList: (data = {}) =>
        request({
            url: "/h5/getXkMovieList",
            method: "GET",
            data,
            custom: {
                showLoading: true,
                showError: true,
            }
        }),
    // 电影订单详情
    getXkMovieDetail: (params = {}) =>
        request({
            url: "/h5/xk-movie/order/orderDetail",
            method: "GET",
            params,
            custom: {
                showLoading: false,
                showError: true,
            }
        }),
    // 查询未支付锁座的订单
    getUnpaid: (params = {}) =>
        request({
            url: "/h5/xk-movie/order/unpaid",
            method: "GET",
            params,  // GET 请求使用 params 而不是 data
            custom: {
                showLoading: false,
                showError: true,
            }
        }),
    // 取消订单
    cancelOrder: (params = {}) =>
        request({
            url: "/h5/xk-movie/order/cancelOrder",
            method: "GET",
            params,  // GET 请求使用 params 而不是 data
            custom: {
                showLoading: true,
                showError: true,
            }
        })
};
